package chapter3;

import chapter2.Vehicle;

public class PassengerVehicle extends Vehicle implements Cloneable {
    private int availableSeats;
    private int occupiedSeats;
    
    PassengerVehicle(){
        super();
        availableSeats = 30;
        occupiedSeats = 0;
    }
    
    public void geton(int i){
        availableSeats -= i;
        occupiedSeats +=i;
    }
    
    public PassengerVehicle clone(){
        //as super resolved clone energy issue
        return (PassengerVehicle)super.clone();
        
    }
    
    public static void main(String[] args){
        Vehicle v = new PassengerVehicle();
        Vehicle v2 = new PassengerVehicle();
        System.out.println(v2);
    }

}
